using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;

namespace RBAC.Domain.QualityManage
{
    /// <summary>
    /// 质检工单主表
    /// </summary>
    [Table("QualityOrder")]
    public class QualityOrder : BaseEntity
    {
        /// <summary>
        /// 质检工单编号（如：CG-20220607-0001）
        /// </summary>
        public string? OrderNo { get; set; }

        /// <summary>
        /// 质检工单主题/名称
        /// </summary>
        public string? Title { get; set; }

        /// <summary>
        /// 来源工单号（如生产工单号）
        /// </summary>
        public string? SourceWorkOrderNo { get; set; }

        /// <summary>
        /// 生产物品Id（可关联物料/产品表）
        /// </summary>
        public long? ProductId { get; set; }

        /// <summary>
        /// 生产物品名称（冗余便于列表展示）
        /// </summary>
        public string? ProductName { get; set; }


        /// <summary>
        /// 质检负责人Id（关联用户）
        /// </summary>
        public long? OwnerUserId { get; set; }

        /// <summary>
        /// 质检负责人名称
        /// </summary>
        public string? OwnerUserName { get; set; }

        /// <summary>
        /// 工序数量
        /// </summary>
        public int? ProcessCount { get; set; }

        /// <summary>
        /// 报工次数
        /// </summary>
        public int? ReportCount { get; set; }

        /// <summary>
        /// 工单状态  未完成=0,已完成=1,已取消=2
        /// </summary>
        public int Status { get; set; } = 0;

        /// <summary>
        /// 备注
        /// </summary>
        public string? Remark { get; set; }

    }
}
